/**
 * Created by DELL on 2017/5/23.
 */
//学生错题集控制器
var appErr=angular.module('appTeacher',['ngResource','ngRoute','oc.lazyLoad','ngCookies']);
appErr.controller("errCtr", function ($resource, $cookieStore, $scope) {
    //获取用户信息
    $scope.username = $cookieStore.get("loginInfo").name;
    $scope.loginOut = function () {
        $cookieStore.remove('loginInfo');
        window.location.href = '../../login.html';
    };
    //创建学生参数
    $scope.stuInfo = '';
    $scope.name = "chapter";
    //创建章节参数
    $scope.chapterInfo = '';
    //创建后台数据接口方法、
    var dataService = {
        //获取学生信息
        getStuData: function (content) {
            $scope.stuInfo = content.data;
            httpServer.getErrChapter($resource, dataService.getChapters);
        },
        //获取章节信息
        getChapters: function (content) {
            $scope.chapterInfo = content.data;
        }
    };
    httpServer.getErrStu($resource, dataService.getStuData);
});
